package com.dili.dd.gpi.service;

import com.dili.dd.gpi.domain.Event;
import com.dili.dd.gpi.exception.BusinessException;
import com.dili.dd.gpi.util.Pagination;
import com.dili.dd.gpi.util.spring.DataSourceLookupKey;
import com.dili.dd.gpi.util.spring.RequireDataSource;

import java.util.List;

/***
 * 自定义事件
 * 
 * @author liangzhu
 * 
 */
public interface DmaEventManageService {

    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    List<Event> queryEventByAppkey(String appkey,Pagination pagination);

    /**
     * @param event
     */
    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    void updateEvent(Event event);

    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    Event queryEvent(String appkey,String eventId) throws BusinessException;

    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    void addEvent(Event event);

    /**
     *
     * @param appkey
     * @param itemId event_id
     */
    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    void deleteEvent(String appkey,String itemId);

    @RequireDataSource(key = DataSourceLookupKey.DMA_DATASOURCE)
    int queryTotalNumByAppkey(String appkey);
}
